unit Bilgi;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, FormClass, XPMan, StdActns, ActnList, StdCtrls, ComCtrls,
  wwriched, Buttons, ExtCtrls, DB, ADODB, siComp;

type
  TfmBilgi = class(TfmFormClass)
    wwDBRichEdit1: TwwDBRichEdit;
    aqEntry: TADOQuery;
    dsEntry: TDataSource;
    Panel1: TPanel;
    btKaydet: TBitBtn;
    ACList: TActionList;
    acKaydet: TAction;
    procedure FormShow(Sender: TObject);
    procedure aqEntryBeforePost(DataSet: TDataSet);
    procedure btKaydetClick(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmBilgi: TfmBilgi;

implementation
uses data, Ana1;
{$R *.dfm}

procedure TfmBilgi.FormShow(Sender: TObject);
begin
  inherited;
  Panel1.Visible := (Anaform.SuperVisor);
  wwDBRichEdit1.ReadOnly := not (Anaform.SuperVisor);

  aqEntry.Close;
  aqEntry.Parameters.ParamByName('FormName').Value := Hint;
  aqEntry.Open;
end;

procedure TfmBilgi.aqEntryBeforePost(DataSet: TDataSet);
begin
  inherited;
  if aqEntry.FieldByName('FormName').isnull then
    aqEntry.FieldByName('FormName').Value := Hint;
end;

procedure TfmBilgi.btKaydetClick(Sender: TObject);
begin
  inherited;
  if aqEntry.State in [dsinsert, dsEdit] then
    aqEntry.Post;
  aqEntry.UpdateBatch;
  Close;
end;

procedure TfmBilgi.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
//  inherited;
  if Key = 27 then
    Close;
end;

procedure TfmBilgi.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  inherited;
  Action := caFree;
  fmBilgi.Close;
end;

end.